package com.dingup.homework.dao;

import com.dingup.homework.bean.DO.HwHomeworkTeacherCorrectDO;
import com.dingup.homework.bean.DTO.TeacherCorrectDTO;
import com.dingup.homework.enums.HomeworkStatusEnum;
import com.dingup.homework.enums.QuestionTypeEnum;
import com.dingup.homework.mappers.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface HwHomeworkTeacherCorrectMapper extends BaseMapper<HwHomeworkTeacherCorrectDO> {

    /**
     * 获取老师的批改列表
     *
     * @param teacherId
     * @param query
     * @return
     */
    List<TeacherCorrectDTO> getCorrectList(@Param("teacherId") String teacherId,
                                           @Param("query") String query,
                                           @Param("status") HomeworkStatusEnum status);

    void updateUnCorrectListTeacher(@Param("homeworkId") Integer homeworkId,
                                    @Param("type") QuestionTypeEnum type,
                                    @Param("teacherId") String teacherId,
                                    @Param("teacherName") String teacherName);

    void updateListFinish(@Param("homeworkRecordId") Integer homeworkRecordId,
                          @Param("examId") String examId,
                          @Param("examIdentity") Integer examIdentity,
                          @Param("endTime") Date endTime,
                          @Param("status") HomeworkStatusEnum status);

    void updateStatusByHomeworkRecordId(@Param("homeworkRecordId") Integer homeworkRecodeId,
                                        @Param("type") QuestionTypeEnum type,
                                        @Param("status") HomeworkStatusEnum status);

    /**
     * 获取为批改数
     *
     * @param teacherId
     * @return
     */
    Integer getUnCorrectListCount(String teacherId);

    List<HwHomeworkTeacherCorrectDO> getFinishOrCorrectHomework(@Param("homeworkId") Integer homeworkId);

    List<String> getTeacherIdByHomeworkRecordId(@Param("homeworkRecordId") Integer homeworkRecordId);

    List<String> getSubjectNameByHomeworkRecordId(@Param("homeworkRecordId") Integer homeworkRecordId,
                                                  @Param("teacherId") String teacherId);

    String getStudentNameByHomeworkRecordId(@Param("homeworkRecordId") Integer homeworkRecordId);
}